import React,{useState,useEffect} from 'react';

export default function TestHook(props){
    let [count,setCount] = useState(0);
    let a = 0;
    useEffect(() => {
        console.log("effect");
        // return function(){
        //     console.log("clean");
        // }
    },[]);
    
    const handleClick = function(){
        setCount(count+1);
    }
    return <div>
        <h1>Hook组件</h1>
        <div>
            计数器:{count}
            <input type="button" value="++" onClick={handleClick} />
        </div>

    </div>
}